<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>进度条</title>
</head>
<style>
    .father{
        height:36px;
        width:900px;
        border:3px solid #000;
        border-radius: 10px;
        margin: 10px auto;
        background-color: #000;
    }
    .son{
        height:30px;
        border:3px solid #000;
        border-radius: 10px;
        background-color: deepskyblue;
        transition: all 1s;
    }
    .btn{
        text-align: center;
    }
    .btn button{
        margin: 10px 30px;
    }
</style>
<body>
    <div id="app">
        <div class="father">
            <div class="son" :style="{width: percent + '%'}">
            </div>
        </div>
        <div class="btn">
            <button @click="add(0)">0%</button>
            <button @click="add(25)">25%</button>
            <button @click="add(50)">50%</button>
            <button @click="add(75)">75%</button>
            <button @click="add(100)">100%</button>
        </div>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
<script>
    const app = new Vue({
        el:'#app',
        data:{
            percent:0
        },
        methods:{
            add(length){
                console.log("当前长度为：" + length);
                this.percent = length ;
            }
        }
    })
</script>
</html>